{extend name="main/index" /}
{block name="main"}
<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>  
        <script>  
              
            function ajaxPost(){  
                var formData = $("#creator").serialize();  
                
                $.ajax({  
                    type:"post",  
                    url:"{:url('admin/priv/docreate')}",  
                    data:formData,
                    dataType:'text',
                    success:function(data){  
                        if(data){
                        	alert("创建成功");
                        }else{
                        	alert("创建失败");
                        }
                    },
                    

                });  
            }  
              
</script> 
<div class="content-page">
    <div class="content">
        <h1>添加权限</h1>
        <form id="creator">
        	<table class="col-md-5  table-bordered"   style="text-align: center;border-collapse:separate;border-spacing:0 0.5rem;">
        		<tr>
        			<td>
        				权限名
        			</td>
        			<td>
        				<input type="text" name="pri_name"> 
        			</td>
        		</tr>
        		<tr>
        			<td>
        				控制器名
        			</td>
        			<td>
        				<input type="text" name="controller_name"> 
        			</td>
        		</tr>
        		<tr>
        			<td>
        				方法名
        			</td>
        			<td>
        				<input type="text" name="action_name"> 
        			</td>
        		</tr>
        		<tr>
        			<td colspan="2">
        			<button onclick="ajaxPost()" style="margin: 10px;">创建权限</button>
                    </td>
        		</tr>
        	</table>
        	
        	
        </form>
    </div>
</div>

{/block}